﻿using Microsoft.AspNetCore.Mvc;
using mozhi.smarterp.Finance.Querys;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;

namespace mozhi.smarterp.Finance.Finances
{
    [RemoteService]
    [Route("api/v1/endperiodprocess/items")]
    public class EndPeriodProcessItemController : BaseController
    {
        private IEndPeriodProcessItemAppService _appService;
        public EndPeriodProcessItemController(IEndPeriodProcessItemAppService appService)
        {
            _appService = appService;
        }

        [HttpGet]
        public async Task<PagedResultDto<EndPeriodProcessItemDto>> GetPageAsync(EndPeriodProcessItemPageQuery query)
        {
            var result = await _appService.FindAsync(query);

            return result;
        }

        [HttpGet]
        [Route("{id}")]
        public async Task<EndPeriodProcessItemDto> GetAsync(Guid id)
        {
            var result = await _appService.GetAsync(id);

            return result;
        }

        [HttpPut]
        public async Task<EndPeriodProcessItemDto> UpdateAsync(EndPeriodProcessItemUpdateDto item)
        {
            var result = await _appService.UpdateAsync(item);

            return result;
        }

    }
}
